package com.leenmvc.core.exception;

import com.leenmvc.core.web.ResultCode;

/**
 * 未授权或者其他权限问题
 */
public class AuthorizedException extends RuntimeException  {

    private String message;

    private Exception e;

    private int code = ResultCode.NO_AUTHORIZED.code;


    public AuthorizedException(String message) {
        this.message = message;
    }

    public AuthorizedException(String message, Exception e) {
        this.message = message;
        this.e = e;
    };

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Exception getE() {
        return e;
    }

    public void setE(Exception e) {
        this.e = e;
    }
}
